package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmCommentMapper;
import com.gaohe.post.domain.FmComment;
import com.gaohe.post.service.IFmCommentService;

/**
 * 评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmCommentServiceImpl implements IFmCommentService 
{
    @Autowired
    private FmCommentMapper fmCommentMapper;

    /**
     * 查询评论
     * 
     * @param commentId 评论主键
     * @return 评论
     */
    @Override
    public FmComment selectFmCommentByCommentId(Long commentId)
    {
        return fmCommentMapper.selectFmCommentByCommentId(commentId);
    }

    /**
     * 查询评论列表
     * 
     * @param fmComment 评论
     * @return 评论
     */
    @Override
    public List<FmComment> selectFmCommentList(FmComment fmComment)
    {
        return fmCommentMapper.selectFmCommentList(fmComment);
    }

    /**
     * 新增评论
     * 
     * @param fmComment 评论
     * @return 结果
     */
    @Override
    public int insertFmComment(FmComment fmComment)
    {
        fmComment.setCreateTime(DateUtils.getNowDate());
        return fmCommentMapper.insertFmComment(fmComment);
    }

    /**
     * 修改评论
     * 
     * @param fmComment 评论
     * @return 结果
     */
    @Override
    public int updateFmComment(FmComment fmComment)
    {
        fmComment.setUpdateTime(DateUtils.getNowDate());
        return fmCommentMapper.updateFmComment(fmComment);
    }

    /**
     * 批量删除评论
     * 
     * @param commentIds 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteFmCommentByCommentIds(Long[] commentIds)
    {
        return fmCommentMapper.deleteFmCommentByCommentIds(commentIds);
    }

    /**
     * 删除评论信息
     * 
     * @param commentId 评论主键
     * @return 结果
     */
    @Override
    public int deleteFmCommentByCommentId(Long commentId)
    {
        return fmCommentMapper.deleteFmCommentByCommentId(commentId);
    }
}
